home *** CD-ROM | disk | FTP | other *** search
/ Regional Industry Buying Guide: Greater Florida / 2000 Regional Industry Buying Guide - Greater Florida.iso / cs2k / clients / classic / scripts.lib / U_CONNCT.SCR < prev    next >
Encoding:
Text File  |  1997-02-26  |  8.7 KB  |  391 lines

  1. !
  2. !  Copyright (c) 1995
  3. !  by CompuServe Incorporated, Columbus, Ohio
  4. !
  5. !  The information in this software is subject to change without
  6. !  notice and should not be construed as a commitment by CompuServe.
  7. !
  8. !  CONNECT:
  9. !    Handles CompuServe and Direct.
  10. !
  11. !  NOTE:  It is recommended that the numeric codes for networks NOT be
  12. !    modified since other utility programs may assume the relationships
  13. !    of network names and network ids specified below.
  14. !
  15. !+V
  16. ! "3.8.1"
  17. !-V
  18.  
  19. !+N
  20. CompuServe = 1;        ! "CompuServe"
  21. AlaskaNet = 36;         ! "AlaskaNet"
  22. Chilepac= 28;        ! "Chilepac"
  23. CSIRnet = 16;        ! "CSIR-Net"
  24. DataPac = 4;        ! "DataPac"
  25. Datex_J = 19;        ! "Datex-J"
  26. Datex_P = 10;        ! "Datex-P"
  27. EIRPAC = 33;            ! "EIRPAC"
  28. FENICSII = 24;        ! "FENICS II"
  29. FTConnect = 12;         ! "FT-Connect"
  30. Dialplus = 11;        ! "GNS Dialplus"
  31. InfoNet_Europe = 5;    ! "InfoNet-Euro"
  32. InfoNet_Korea = 29;    ! "InfoNet-Kor"
  33. InfoNet_Mexico = 31;    ! "InfoNet-Mex"
  34. InfoNet_SAfrica = 32;    ! "InfoNet-RSA"
  35. InfoNet_Taiwan = 30;    ! "InfoNet-Taiw"
  36. InfoNet_World = 6;    ! "InfoNet-Wrld"
  37. Internet = 25;        ! "Internet"
  38. ISRAKAV = 17;        ! "ISRAKAV"
  39. LATA = 7;        ! "LATA"
  40. CTLATA = 8;        ! "LATA-Ct"
  41. Mercury = 15;        ! "Mercury"
  42. PacNet = 21;        ! "PacNet"
  43. PosServe = 27;        ! "Pos-Serve LL"
  44. SCITOR = 34;            ! "SCITOR"
  45. SEVA = 35;              ! "SEVA"
  46. Telenet = 2;        ! "SprintNet"
  47. Telepac = 9;        ! "Telepac"
  48. Transpac = 18;        ! "Transpac"
  49. TTNNet = 22;        ! "TTN-Net"
  50. Tymnet = 3;        ! "Tymnet"
  51. VNZNET = 23;        ! "VNZ-Net"
  52. Direct = 40;    ! "Direct"
  53. !-N
  54.  
  55. define %CR = "^M";
  56. define %FALSE = 0;
  57. define %TRUE = 1;
  58. define %ErrorCode = 0;
  59. define %PPP = "";
  60. hangup = 1;
  61. UsingModem = %FALSE;
  62. CISNetwork = %FALSE;
  63. ifndef %App = "";
  64. if (%App = "CID") and (%Network = Internet) goto Dialer;
  65.  
  66. Initialize:
  67. !
  68. ! Main Program
  69. !
  70. init %Port, %BaudRate;
  71. if %_init goto Continue_Connect;
  72.  
  73. %_init = 1;   ! Force toolbox to use this message
  74. define %FailureMsg = "Modem off?  Port open?  Wrong modem def?";
  75. define %ErrorCode = 2;
  76. if %Network <> Internet goto Connect_Fatal;
  77. define %ErrorCode = 3;
  78. goto Connect_Fatal;
  79.  
  80. Dialer:
  81. define %Network = CompuServe;
  82. goto Initialize;
  83.  
  84. Continue_Connect:
  85.     call %Dir & "first.scr" () : Result;
  86.     if Result = %Cancel goto Cancel_Connect;
  87.     if Result = %Failure goto Connect_Failure;
  88.     if Result = %Fatal goto Connect_Fatal;
  89.  
  90.     on cancel goto Cancel_Connect;
  91.     DirectConnect = (%Network = Direct) or (%DialType = 2);
  92.  
  93.     if DirectConnect goto Connect_Network;
  94.  
  95.     call %Dir & "phone.scr" () : Result;
  96.  
  97.     if Result = %Cancel goto Cancel_Connect;
  98.     if Result = %Failure goto Connect_Failure;
  99.     if Result = %Fatal goto Connect_Fatal;
  100.     UsingModem = %TRUE;
  101.  
  102. Connect_Network:
  103.     if %Network = CompuServe goto Connect_CIS;
  104.     if %Network = Direct goto Connect_CIS;
  105.     if %Network = Telenet goto Connect_Telenet;
  106.     if %Network = Tymnet goto Connect_Tymnet;
  107.     if %Network = DataPac goto Connect_DataPac;
  108.     if %Network = InfoNet_Europe goto Connect_InfoNet_Europe;
  109.     if %Network = InfoNet_Korea goto Connect_InfoNet_Korea;
  110.     if %Network = InfoNet_Taiwan goto Connect_InfoNet_Taiwan;
  111.     if %Network = InfoNet_Mexico goto Connect_InfoNet_Mexico;
  112.     if %Network = InfoNet_SAfrica goto Connect_InfoNet_SAfrica;
  113.     if %Network = InfoNet_World goto Connect_InfoNet_World;
  114.     if %Network = Internet goto Connect_CIS;
  115.     if %Network = LATA goto Connect_LATA;
  116.     if %Network = CTLATA goto Connect_CTLATA;
  117.     if %Network = Telepac goto Connect_Telepac;
  118.     if %Network = Datex_P goto Connect_Datex_P;
  119.     if %Network = Datex_J goto Connect_Datex_J;
  120.     if %Network = Dialplus goto Connect_Dialplus;
  121.     if %Network = Mercury goto Connect_Mercury;
  122.     if %Network = CSIRnet goto Connect_CSIRnet;
  123.     if %Network = ISRAKAV goto Connect_ISRAKAV;
  124.     if %Network = Transpac goto Connect_Transpac;
  125.     if %Network = PacNet goto Connect_PacNet;
  126.     if %Network = PosServe goto Connect_PosServe;
  127.     if %Network = TTNNet goto Connect_TTNNet;
  128.     if %Network = FENICSII goto Connect_FENICSII;
  129.     if %Network = VNZNET goto Connect_CIS;
  130.     if %Network = Chilepac goto Connect_Chilepac;
  131.         if %Network = EIRPAC goto Connect_EIRPAC;
  132.         if %Network = SCITOR goto Connect_SCITOR;
  133.         if %Network = SEVA goto Connect_SEVA;
  134.         if %Network = AlaskaNet goto Connect_AlaskaNet;
  135.         if %Network = FTConnect goto Connect_FTConnect;
  136.  
  137.     define %FailureMsg = "Network not supported";
  138.     goto Connect_Fatal;
  139.  
  140. !
  141. !  Connect to Telenet
  142. !
  143. Connect_Telenet:
  144.     call %Dir & "telenet.scr" () : Result;
  145.     goto Handle_Network_Return;
  146.  
  147. !
  148. !  Connect to Tymnet
  149. !
  150. Connect_Tymnet:
  151.     call %Dir & "tymnet.scr" (1) : Result;
  152.     goto Handle_Network_Return;
  153.  
  154. !
  155. !  Connect to DataPac
  156. !
  157. Connect_DataPac:
  158.     call %Dir & "datapac.scr" () : Result;
  159.     goto Handle_Network_Return;
  160.  
  161. !
  162. !  Connect to InfoNet World
  163. !
  164. Connect_InfoNet_World:
  165.     call %Dir & "infonet.scr" (0) : Result;
  166.     goto Handle_Network_Return;
  167.  
  168. !
  169. !  Connect to InfoNet Europe
  170. !
  171. Connect_InfoNet_Europe:
  172.     call %Dir & "infonet.scr" (1) : Result;
  173.     goto Handle_Network_Return;
  174.  
  175. !
  176. !  Connect to InfoNet Korea
  177. !
  178. Connect_InfoNet_Korea:
  179.     call %Dir & "infonet.scr" (2) : Result;
  180.     goto Handle_Network_Return;
  181.  
  182. !
  183. !  Connect to InfoNet Taiwan
  184. !
  185. Connect_InfoNet_Taiwan:
  186.     call %Dir & "infonet.scr" (3) : Result;
  187.     goto Handle_Network_Return;
  188.  
  189. !
  190. !  Connect to InfoNet Mexico
  191. !
  192. Connect_InfoNet_Mexico:
  193.     call %Dir & "infonet.scr" (4) : Result;
  194.     goto Handle_Network_Return;
  195.  
  196. !
  197. !  Connect to InfoNet South Africa
  198. !
  199. Connect_InfoNet_SAfrica:
  200.     call %Dir & "infonet.scr" (5) : Result;
  201.     goto Handle_Network_Return;
  202.  
  203. !
  204. !  Connect to LATA
  205. !
  206. Connect_LATA:
  207.     call %Dir & "lata.scr" (%TRUE) : Result;
  208.     goto Handle_Network_Return;
  209.  
  210. !
  211. !  Connect to Connecticut LATA
  212. !
  213. Connect_CTLATA:
  214.     call %Dir & "lata.scr" (%FALSE) : Result;
  215.     goto Handle_Network_Return;
  216.  
  217. !
  218. !  Connect to Telepac
  219. !
  220. Connect_Telepac:
  221.     call %Dir & "telepac.scr" () : Result;
  222.     goto Handle_Network_Return;
  223.  
  224. !
  225. !  Connect to Datex-P
  226. !
  227. Connect_Datex_P:
  228.     call %Dir & "datexp.scr" () : Result;
  229.     goto Handle_Network_Return;
  230.  
  231. !
  232. !  Connect to Datex-J
  233. !
  234. Connect_Datex_J:
  235.     call %Dir & "datexj.scr" () : Result;
  236.     goto Handle_Network_Return;
  237.  
  238. !
  239. !  Connect to Dialplus
  240. !
  241. Connect_Dialplus:
  242.     call %Dir & "dialplus.scr" () : Result;
  243.     goto Handle_Network_Return;
  244.  
  245. !
  246. !  Connect to FT-Connect
  247. !
  248. Connect_FTConnect:
  249.         call %Dir & "ftconn.scr" () : Result;
  250.     goto Handle_Network_Return;
  251.  
  252. !
  253. !  Connect to Mercury
  254. !
  255. Connect_Mercury:
  256.     call %Dir & "mercury.scr" () : Result;
  257.     goto Handle_Network_Return;
  258.  
  259. !
  260. !  Connect to CSIR-Net
  261. !
  262. Connect_CSIRnet:
  263.     call %Dir & "csirnet.scr" () : Result;
  264.     goto Handle_Network_Return;
  265.  
  266. !
  267. !  Connect to ISRAKAV
  268. !
  269. Connect_ISRAKAV:
  270.     call %Dir & "israkav.scr" () : Result;
  271.     goto Handle_Network_Return;
  272.  
  273. !
  274. !  Connect to Transpac
  275. !
  276. Connect_Transpac:
  277.     call %Dir & "transpac.scr" () : Result;
  278.     goto Handle_Network_Return;
  279.  
  280. !
  281. !  Connect to AlaskaNet
  282. !
  283. Connect_AlaskaNet:
  284.     call %Dir & "tymnet.scr" (2) : Result;
  285.     goto Handle_Network_Return;
  286.  
  287. !
  288. !  Connect to PacNet
  289. !
  290. Connect_PacNet:
  291.     call %Dir & "tymnet.scr" (3) : Result;
  292.     goto Handle_Network_Return;
  293.  
  294.     
  295. !
  296. !  Connect to Pos-Serve
  297. !
  298. Connect_PosServe:
  299.     call %Dir & "posserve.scr" () : Result;
  300.     goto Handle_Network_Return;
  301.  
  302. !
  303. !  Connect to TTN-Net
  304. !
  305. Connect_TTNNet:
  306.     call %Dir & "ttnnet.scr" (3) : Result;
  307.     goto Handle_Network_Return;
  308.  
  309. !
  310. !  Connect to FENICS II
  311. !
  312. Connect_FENICSII:
  313.     call %Dir & "fenics2.scr" (3) : Result;
  314.     goto Handle_Network_Return;
  315.  
  316. !
  317. !  Connect to Chilepac
  318. !
  319. Connect_Chilepac:
  320.     call %Dir & "chilepac.scr" (3) : Result;
  321.     goto Handle_Network_Return;
  322.  
  323. !
  324. !  Connect to EIRPAC
  325. !
  326. Connect_EIRPAC:
  327.         call %Dir & "eirpac.scr" () : Result;
  328.     goto Handle_Network_Return;
  329.  
  330. !
  331. !  Connect to SCITOR
  332. !
  333. Connect_SCITOR:
  334.         call %Dir & "scitor.scr" () : Result;
  335.     goto Handle_Network_Return;
  336.  
  337. !
  338. !  Connect to SEVA
  339. !
  340. Connect_SEVA:
  341.         call %Dir & "seva.scr" () : Result;
  342.     goto Handle_Network_Return;
  343.  
  344.  
  345. !
  346. !  Handle Network Return
  347. !
  348. Handle_Network_Return:
  349.     if Result = %Success goto Do_CIS_Script;
  350.     if Result = %Cancel goto Cancel_Connect;
  351.     if Result = %Fatal goto Connect_Fatal;
  352.     goto Connect_Failure;
  353.  
  354. !
  355. !  Connect to CIS
  356. !
  357. Connect_CIS:
  358.     CISNetwork = %TRUE;
  359.     send %CR;
  360.  
  361. Do_CIS_Script:
  362.     call %Dir & "u_cserve.scr" (DirectConnect, CISNetwork) : Result;
  363.     if Result = %Failure goto Connect_Failure;
  364.     if Result = %Cancel goto Cancel_Connect;
  365.     if Result = %Fatal goto Connect_Fatal;
  366.     exit %Success;
  367.  
  368. Connect_Failure:
  369.     gosub Hangup_Connect;
  370.     reset;
  371.     exit %Failure;
  372.  
  373. Connect_Fatal:
  374.     gosub Hangup_Connect;
  375.     reset;
  376.     exit %Fatal;
  377.  
  378. Hangup_Connect:
  379.     if not UsingModem goto Hangup_Done;
  380.     define %LOCAL = 1;
  381.     call %Dir & "disconct.scr" ();
  382. Hangup_Done:
  383.     return;
  384.  
  385. Cancel_Connect:
  386.     show "Connect cancelled";
  387.     gosub Hangup_Connect;
  388.     reset;
  389.     define %ErrorCode = 1;
  390.     exit %Cancel;
  391.